home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <exec/ports.h>
- #include <exec/memory.h>
- #include <dos/dos.h>
- #include <clib/exec_protos.h>
- #include <clib/dos_protos.h>
- #include <clib/alib_protos.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #include <time.h>
- void lowerstring(char *s);
- void upperstring(char *s);
-
- struct TempUser
- {
- UWORD Slot_Number; // ( 2) Account#
- UBYTE Status; // ( 1) 0=Deleted, 1=Active, 2=New User, 3=Locked Out, 4=Created Account
-
- TEXT Name[31], // ( 31) Users Name
- RealName[26], // ( 26) Real Name
- VoicePhone[21], // ( 21) Voice Phone Number
- DataPhone[21], // ( 21) Data Phone Number
- Address[26], // ( 26) Address
- City[26], // ( 26) City
- State[4], // ( 4) State/Providence Code
- Country[4], // ( 4) Country Code
- MailRoute[15], // ( 15) Zip Code / Mail Route
- ComputerType[21], // ( 21) Computer Type (Possible Code Instead)
- Password[16], // ( 16) Password
- Comment[31]; // ( 31) Comment String
-
- UBYTE Security; // ( 1) Access Level
- UWORD WeedDays, // ( 2) Days of inactivity until bbs auto deletes
- ReduceDays; // ( 2) Days Paid for by a payer. (NOT USED YET)
- UBYTE ReducedAccess; // ( 1) Preset level to give to user after reduced days (NOT USED YET)
-
- UBYTE AnsiType, // ( 1) Ansi Type 0) Normal, 1) Amiga, 2) IBM, 3) RIP
- Protocol, // ( 1) Protocol Selected: 0:Zmodem 1:Hydra
- DEADProto, // ( 1) Not Used Anymore
- HelpLevel, // ( 1) Level of Help
- MSGHeader, // ( 1) Msg Header Type
- EditorLines, // ( 1) Max Lines allowed in Editor (NOT USED YET)
- DescLines, // ( 1) File Listing lines, Descriptions
- ViewMode, // ( 1) File Listing View Mode
- WhoPrefs, // ( 1) Who Preferences
- MB_J, // ( 1) Message Rejoin
- FB_J, // ( 1) File rejoin
- Length, // ( 1) Length of screen
- Width, // ( 1) Width of screen
- Language, // ( 1)
- Translation, // ( 1) (NOT USED YET)
- TimeZone, // ( 1) Time Zone Offset (NOT USED YET)
- BirthDate_Day, // ( 1) DAY of birth
- BirthDate_Month, // ( 1) MONTH of birth
- BirthDate_Year, // ( 1) YEAR of birth
- IdleTime, // ( 1) Idle time allowed for no activity (NOT USED YET)
- NodeLastOn; // ( 1) Last node user was on
-
- UWORD ForwardMailSlot, // ( 2) Slot Number of user to forward mail to! (NOT USED YET)
- PWF; // ( 2) Number of Password Failures
-
- UWORD Total_Calls, // ( 2) # of Calls Total
- Total_Posts, // ( 2) Msgs left total
- Total_PostsReceived, // ( 2) Msgs Received
- Total_ULFiles, // ( 2) # of Uploads
- Total_DLFiles, // ( 2) # of Downloads
- Total_TimeBank; // ( 2) Time Bank Value
- ULONG Total_ULBytes, // ( 4) Total Uploaded Bytes
- Total_DLBytes; // ( 4) Total Downloaded Bytes
-
- UWORD Limit_Calls, // ( 2) Calls ALLOWED per Day
- Limit_Posts, // ( 2) Messages Allowed p/d
- Limit_ULFiles, // ( 2) # of Uploads Per Period
- Limit_DLFiles, // ( 2) # of Downloads Per Period
- Limit_Time, // ( 2) Time Limit per day.
- Limit_TimeBank, // ( 2)
- Limit_ChatTime; // ( 2) Limit of Time user can be in chat door
- ULONG Limit_ULBytes, // ( 4) Limit Upload Bytes Per Period
- Limit_DLBytes; // ( 4) Limit Download Bytes Per Period
-
- UBYTE F_Ratio, // ( 1) File Ratio
- B_Ratio; // ( 1) Byte Ratio
-
- UBYTE Period_Type; // ( 1) Mins, Hours, Days, Weeks, Months, Years (NOT USED YET)
- UWORD Period_Length, // ( 2) 24 hours or whatever! Set Limits by Period (NOT USED YET)
- Period_Calls, // ( 2) Calls made Today
- Period_Posts, // ( 2) Todays Msgs Sent
- Period_ULFiles, // ( 2) Todays Ul's
- Period_DLFiles, // ( 2) Todays Dl's
- Period_ChatTime; // ( 2) Time user has been in chat this period
- ULONG Period_ULBytes, // ( 4) Period Bytes Uploaded
- Period_DLBytes; // ( 4) Period Bytes Downloaded
-
- UWORD Left_DLFiles, // ( 2) Files left available for download
- Left_ChatTime, // ( 2) Limit of Time user can be in chat door
- Left_Time; // ( 2) Time Left
- ULONG Left_DLBytes; // ( 4) Bytes left for this period
-
- UWORD DayCredits, // ( 2) For Payers
- FileCredits; // ( 2) Files Paid for by a payer.
-
- ULONG ByteCredits, // ( 4) Bytes Paid for by a payer.
- PersonalBytes, // ( 4) Personal Area Bytes Limit
- LastBaudRate; // ( 4) Last Baud Rate of a user.
-
- LONG Time_First_Called, // ( 4) Time First Logged On
- Time_Last_Logoff, // ( 4) Last Time LOGGED OFF
- Time_Last_Connect; // ( 4) Time last CONNECTED
-
- LONGBITS UserBitsA, // ( 4)
- UserBitsB, // ( 4)
- UtilBits, // ( 4) 32 bits for Programmers to use as they wish for utils.
- LastCallFlags, // ( 4) Flags for activities during last call. Posted,UL,DL,etc (NOT USED YET)
- CatFlags, // ( 4) Flags for Custom File Listing (NOT USED YET)
-
- NFlags1, // ( 4) Normal Flags Part 1
- NFlags2, // ( 4) Normal Flags Part 2
- SFlags1, // ( 4) Sysop Flags Part 1
- SFlags2; // ( 4) Sysop Flags Part 2
-
- char MsgBase[41], // (1x41=41) MB 0-39 Flags N,Y,S // Change to 2 LONGBITS
- FileBase[41]; // (1x41=41) FB 0-39 Flags N,Y,S // one for normal, one for sysop
-
- UWORD Last_Read_Message[40], // (40x2=80) -position change- Last read pointer
- Last_Scan_Message[40]; // (40x2=80)
-
- BYTE AnsiColor; // ( 1) Ansi Color
- BYTE BExtras[29]; // (1x29=29)
-
- UWORD CheckSum, // ( 2)
- SerialNumber; // ( 2) Unique seiral number for flagged files, etc. (NOT USED YET)
-
- SHORT SExtras[3]; // (3x2=6)
- LONG LExtras[3]; // (3x4=12)
- };
-
-
- struct User {
- char Name[31],Pass[9],Location[30],PhoneNumber[13];
- USHORT Slot_Number;
- USHORT Sec_Status,
- Sec_Board, /* File or Byte Ratio */
- Sec_Library, /* Ratio */
- Sec_Bulletin, /* Computer Type */
- Messages_Posted; /* Note ConfYM = the last msg you actually read, ConfRead is the same ?? */
- ULONG NewSinceDate;
- ULONG ConfRead1, ConfRead2, ConfRead3, ConfRead4, ConfRead5, ConfRead6,
- ConfRead7, ConfRead8, ConfRead9;
- char Conference_Access[10];
- USHORT Uploads, Downloads, ConfRJoin, Times_Called;
- long Time_Last_On, Time_Used, Time_Limit, Time_Total;
- ULONG Bytes_Download,
- Bytes_Upload,
- Daily_Bytes_Limit,
- Daily_Bytes_Dld;
- char Expert;
- double NBytes_Download, // Bytes Downloaded as a "double"
- NBytes_Upload, // Bytes Uploaded as a "double"
- NDaily_Bytes_Limit, // Daily Bytes Limit
- NDaily_Bytes_Dld; // Bytes Downloaded today.
- UBYTE Flag1, Flag2, FLag3, EditorType;
- long BeginLogCall;
- UBYTE Protocol, UUCPA, LineLength, New_User;
- }; // UUCPA == AnsiUserFlag!
- ///
- /// Struct for User.keys!
- struct UserKeys { /* changes to UserKeys (RTS) */
- char UserName[31];
- long Number;
- UBYTE New_User;
- UWORD UPcps, /* highest upload cps rate */
- DNcps, /* highest dnload cps rate */
- Userflags, /* */
- baud_rate; /* last online baud rate */
- UBYTE QFlag,
- Who,
- MailScan,
- Language,
- QuietNode,
- MaxCalls,
- Called,
- ReplySkip;
- char Pad[1]; /* ?? should be 15 */
- };
-
-
-
- void main(int argc, char *argv[])
- {
-
- char buffer[255];
- ULONG slot=1;
- struct TempUser *tuser=NULL;
- struct User *user=NULL;
- struct UserKeys *userkeys=NULL;
- BPTR readfh=NULL,writefh=NULL,writefh2=NULL;
-
- printf("Convert Tempest Userdata to Sexpress Userdata!\n");
- if (argc!=2)
- {
- printf("Usage: Convert <Tempest Userdata>\n");
- exit(5);
- }
-
- readfh=Open(argv[1],MODE_OLDFILE);
- if (!readfh)
- {
- printf("Couldn`t open Tempest Datafile!\n");
- exit(5);
- }
-
- writefh=Open("ram:User.data",MODE_NEWFILE);
- writefh2=Open("ram:User.keys",MODE_NEWFILE);
-
- tuser =(struct TempUser *) malloc (sizeof(struct TempUser));
- user =(struct User *) malloc (sizeof(struct User));
- userkeys=(struct UserKeys *) malloc (sizeof(struct UserKeys));
-
- while (Read(readfh,tuser,sizeof(struct TempUser)))
- {
-
- if (tuser->Status==1 || tuser->Status==2 || tuser->Status==4)
- {
-
- printf("Processing: %3d %s\n",slot,tuser->Name);
-
-
- strcpy(user->Name,tuser->Name);
- sprintf(user->Pass,"%.8s",tuser->Password);
- strcpy(user->Location,tuser->City);
- sprintf(user->PhoneNumber,"%.12s",tuser->VoicePhone);
- user->Slot_Number=slot;
- user->Sec_Board=0;
- user->Sec_Library=tuser->B_Ratio;
- user->Sec_Bulletin=0;
- user->Sec_Status=tuser->Security;
- user->Messages_Posted=tuser->Total_Posts;
- strcpy(user->Conference_Access,"Normal");
- user->Uploads=tuser->Total_ULFiles;
- user->Downloads=tuser->Total_DLFiles;
- user->ConfRJoin=1;
- user->Times_Called=tuser->Total_Calls;
- user->Time_Last_On=tuser->Time_Last_Logoff;
- user->Time_Used=0;
- user->Time_Limit=tuser->Limit_Time;
- user->Time_Total=tuser->Limit_Time;
- user->Bytes_Upload=tuser->Total_ULBytes;
- user->Bytes_Download=tuser->Total_DLBytes;
- user->Daily_Bytes_Limit=tuser->Limit_DLBytes;
- user->Daily_Bytes_Dld=tuser->Period_DLBytes;
- user->Expert=0;
- user->NBytes_Upload=(double)tuser->Total_ULBytes;
- user->NBytes_Download=(double)tuser->Total_DLBytes;
- user->NDaily_Bytes_Limit=(double)tuser->Limit_DLBytes;
- user->NDaily_Bytes_Dld=(double)tuser->Period_DLBytes;
- user->Flag1=0;
- user->Flag2=0;
- user->FLag3=0;
- user->EditorType=0;
- user->BeginLogCall=0;
- user->Protocol=0;
- user->UUCPA=0;
- user->New_User=0;
- user->LineLength=tuser->Length;
-
- strcpy(userkeys->UserName,tuser->Name);
- userkeys->Number=slot++;
- userkeys->New_User=0;
- userkeys->UPcps=0;
- userkeys->DNcps=0;
- userkeys->Userflags=0;
- userkeys->baud_rate=tuser->LastBaudRate;
- userkeys->QFlag=0;
- userkeys->Who=0;
- userkeys->MailScan=0;
- userkeys->Language=0;
- userkeys->QuietNode=0;
- userkeys->MaxCalls=99;
- userkeys->Called=1;
- userkeys->ReplySkip=0;
-
- Write(writefh,user,sizeof(struct User));
- Write(writefh2,userkeys,sizeof(struct UserKeys));
-
- }
- }
-
- if (readfh) Close(readfh);
- if (writefh) Close(writefh);
- if (writefh2) Close(writefh2);
-
- free(user);
- free(tuser);
- free(userkeys);
-
-
- }
-
-
-
- void lowerstring(char *s)
- {
- while((*s=tolower(*s)) != '\0') s++;
- }
- void upperstring(char *s)
- {
- while((*s=toupper(*s)) != '\0') s++;
- }
-